package xj.graph2d.command;

import xj.graph2d.DrawShape;
import xj.graph2d.SimpleDrawDocument;
import xj.graph2d.SimpleDrawView;

public class MoveCommand extends DeltaCommand {

  public MoveCommand(SimpleDrawView view, 
		     SimpleDrawDocument doc,
		     DrawShape shape) {
    super(view, doc, shape);
  }

  @Override
  protected void forward() {
    shape.move(x, y);
  }

  @Override
  protected void backward() {
    shape.move(-x, -y);
  }

  @Override
  public boolean isSignificant() {
    return (x != 0 || y != 0);
  }

}
